home *** CD-ROM | disk | FTP | other *** search
/ IRIX Base Documentation 2001 May / SGI IRIX Base Documentation 2001 May.iso / usr / share / catman / p_man / cat3 / Vk / VkPeriodic.z / VkPeriodic
Encoding:
Text File  |  1998-10-20  |  6.5 KB  |  199 lines

  1.  
  2.  
  3.  
  4. VVVVkkkkPPPPeeeerrrriiiiooooddddiiiicccc((((3333xxxx))))                                                  VVVVkkkkPPPPeeeerrrriiiiooooddddiiiicccc((((3333xxxx))))
  5.  
  6.  
  7.  
  8. NNNNAAAAMMMMEEEE
  9.      VkPeriodic - Support for performing actions at regular periodic intervals
  10.  
  11. IIIINNNNHHHHEEEERRRRIIIITTTTSSSS FFFFRRRROOOOMMMM
  12.      VkCallbackObject
  13.  
  14. HHHHEEEEAAAADDDDEEEERRRR FFFFIIIILLLLEEEE
  15.      #include <Vk/VkPeriodic.h>
  16.  
  17. PPPPUUUUBBBBLLLLIIIICCCC PPPPRRRROOOOTTTTOOOOCCCCOOOOLLLL SSSSUUUUMMMMMMMMAAAARRRRYYYY
  18.    CCCCoooonnnnssssttttrrrruuuuccccttttoooorrrr////DDDDeeeessssttttrrrruuuuccccttttoooorrrr
  19.            VkPeriodic(int interval);
  20.            virtual void ~VkPeriodic(void);
  21.  
  22.  
  23.    SSSSttttaaaarrrrttttiiiinnnngggg aaaannnndddd SSSSttttooooppppppppiiiinnnngggg
  24.            void start(void);
  25.            void stop(void);
  26.  
  27.  
  28. PPPPRRRROOOOTTTTEEEECCCCTTTTEEEEDDDD PPPPRRRROOOOTTTTOOOOCCCCOOOOLLLL SSSSUUUUMMMMMMMMAAAARRRRYYYY
  29.    UUUUppppddddaaaatttteeeessss
  30.            virtual void tick(void);
  31.  
  32.  
  33.    PPPPrrrrooootttteeeecccctttteeeedddd DDDDaaaattttaaaa MMMMeeeemmmmbbbbeeeerrrrssss
  34. CCCCLLLLAAAASSSSSSSS DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNN
  35.           VkPeriodic provides a simple, convenient interface to the Xt timeout
  36.           mechanism. For many applications, it is sufficient to call
  37.           _X_t_A_p_p_A_d_d_T_i_m_e_O_u_t() directly. However, VkPeriodic provides the ability
  38.           to encapsulate a common use of _X_t_A_p_p_A_d_d_T_i_m_e_O_u_t(), as a cyclic timer,
  39.           in a C++ class.
  40.  
  41.           The VkPeriodic class can be used in one of two way. The first is to
  42.           derive a new class from VkPeriodic that overrides the _t_i_c_k() virtual
  43.           member function. The _t_i_c_k() member function is called for each cycle
  44.           of the periodic timeout. This approach has the advantage that any
  45.           data being used in connection with the timeout can be declared and
  46.           maintained as data member(s) of the derived class.
  47.  
  48.           The VkPeriodic class also supports a ViewKit callback that allows
  49.           other C++ classes to register member functions to be called with
  50.           each periodic timeout. This approach is more convenient when a
  51.           simple timer is needed to drive some other class.
  52.  
  53.           These two methods are not mutually-exclusive, and both approaches
  54.           may be used together at once.
  55.  
  56.  
  57.  
  58.  
  59.  
  60.  
  61.  
  62.  
  63.                                                                         PPPPaaaaggggeeee 1111
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70. VVVVkkkkPPPPeeeerrrriiiiooooddddiiiicccc((((3333xxxx))))                                                  VVVVkkkkPPPPeeeerrrriiiiooooddddiiiicccc((((3333xxxx))))
  71.  
  72.  
  73.  
  74. FFFFUUUUNNNNCCCCTTTTIIIIOOOONNNN DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNNSSSS
  75.    ttttiiiicccckkkk(((())))
  76.            virtual void tick(void);
  77.  
  78.  
  79.           This function can be overridden by derived classes to allow them to
  80.           be notified when each timeout occurs.
  81.  
  82.    VVVVkkkkPPPPeeeerrrriiiiooooddddiiiicccc(((())))
  83.            VkPeriodic(int interval);
  84.  
  85.  
  86.           The constructor initializes a VkPeriodic object, creating a timer to
  87.           be called every _i_n_t_e_r_v_a_l milliseconds. The interval is approximate
  88.           because it relies on the underlying Xt mechanism, which is based on
  89.           _s_e_l_e_c_t(). If an application does not return to the Xt event loop
  90.           regularly, the timeout will not occur.
  91.  
  92.    ~~~~VVVVkkkkPPPPeeeerrrriiiiooooddddiiiicccc(((())))
  93.            virtual void ~VkPeriodic(void);
  94.  
  95.  
  96.           Clean up all memory allocated by a VkPeriodic object. Any pending
  97.           timer is removed.
  98.  
  99.    ssssttttaaaarrrrtttt(((())))
  100.            void start(void);
  101.  
  102.  
  103.           Start the timer. This function must be called to start the periodic
  104.           timeouts.
  105.  
  106.    ssssttttoooopppp(((())))
  107.            void stop(void);
  108.  
  109.  
  110.           Stop the timer.
  111.  
  112.    ssssttttaaaattttiiiicccc ccccoooonnnnsssstttt cccchhhhaaaarrrr ****ccccoooonnnnsssstttt ttttiiiimmmmeeeerrrrCCCCaaaallllllllbbbbaaaacccckkkk;;;;
  113.            static const char *const timerCallback;
  114.  
  115.  
  116.           This callback list allows other C++ classes derived from
  117.           VkCallbackObject to register member functions to be called at
  118.           periodic intervals.
  119.  
  120. IIIINNNNHHHHEEEERRRRIIIITTTTEEEEDDDD MMMMEEEEMMMMBBBBEEEERRRR FFFFUUUUNNNNCCCCTTTTIIIIOOOONNNNSSSS
  121.    IIIInnnnhhhheeeerrrriiiitttteeeedddd ffffrrrroooommmm VVVVkkkkCCCCaaaallllllllbbbbaaaacccckkkkOOOObbbbjjjjeeeecccctttt
  122.           callCallbacks(), addCallback(), removeCallback(),
  123.           removeAllCallbacks()
  124.  
  125.      _V_i_e_w_K_i_t _P_r_o_g_r_a_m_m_e_r'_s _G_u_i_d_e
  126.  
  127.  
  128.  
  129.                                                                         PPPPaaaaggggeeee 2222
  130.  
  131.  
  132.  
  133.  
  134.  
  135.  
  136. VVVVkkkkPPPPeeeerrrriiiiooooddddiiiicccc((((3333xxxx))))                                                  VVVVkkkkPPPPeeeerrrriiiiooooddddiiiicccc((((3333xxxx))))
  137.  
  138.  
  139.  
  140.      _T_h_e _X _W_i_n_d_o_w _S_y_s_t_e_m, DEC Press, Bob Sheifler and Jim Gettys
  141.      _T_h_e _X _W_i_n_d_o_w _S_y_s_t_e_m _T_o_o_l_k_i_t, DEC Press, Paul Asente and Ralph Swick
  142.      _T_h_e _O_S_F/_M_o_t_i_f _P_r_o_g_r_a_m_m_e_r_s _R_e_f_e_r_e_n_c_e, Prentice Hall, OSF
  143.  
  144.  
  145.  
  146.  
  147.  
  148.  
  149.  
  150.  
  151.  
  152.  
  153.  
  154.  
  155.  
  156.  
  157.  
  158.  
  159.  
  160.  
  161.  
  162.  
  163.  
  164.  
  165.  
  166.  
  167.  
  168.  
  169.  
  170.  
  171.  
  172.  
  173.  
  174.  
  175.  
  176.  
  177.  
  178.  
  179.  
  180.  
  181.  
  182.  
  183.  
  184.  
  185.  
  186.  
  187.  
  188.  
  189.  
  190.  
  191.  
  192.  
  193.  
  194.  
  195.                                                                         PPPPaaaaggggeeee 3333
  196.  
  197.  
  198.  
  199.